package main

//#link: https://leetcode-cn.com/problems/first-bad-version/
func main() {

}

func firstBadVersion(n int) int {
	begin, end := 0, n
	for begin < end {
		mid := begin + (end-begin)>>1
		//中间版本出错了
		if ok := isBadVersion(mid); ok {
			end = mid
		} else {
			begin = mid + 1
		}
	}
	return begin
}

func isBadVersion(version int) bool {
	return true
}
